package com.wave.common.exception;

import com.wave.common.enums.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;


@Data
@EqualsAndHashCode(callSuper = true)
public class WaveException extends RuntimeException {

    private Integer code;
    private String msg;

    public WaveException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
        this.msg = errorCode.getMessage();
    }

    public WaveException(String msg) {
        super(msg);
        this.code = ErrorCode.ERROR.getCode();
        this.msg = msg;
    }

    public WaveException(ErrorCode errorCode, String msg) {
        super(msg);
        this.code = errorCode.getCode();
        this.msg = msg;
    }

}
